草庐IT

php - heroku 上的 cURL 超时

全部标签

ruby - 执行 rake db :migrate on Heroku 时出错

做的时候heroku运行rakedb:migrate所有迁移都已执行,最后我总是收到以下消息:/app/vendor/bundle/ruby/1.9.1/bin/rake:没有这样的文件或目录-pg_dump-i-s-x-O-f/app/db/structure.sqldan79p98fykovu我无法在Heroku上将pg_dump添加到PATH。如何处理? 最佳答案 问题在于,迁移完成后,rails会尝试转储新的structure.sql,但由于pg_dump不存在而失败。为已部署的应用程序生成新的structure.sql毫无

ruby - 如何在 Ruby 中设置套接字超时?

如何设置Ruby套接字阻塞操作的超时时间? 最佳答案 我发现似乎有效的解决方案是使用Timeout::timeout:require'timeout'...begintimeout(5)domessage,client_address=some_socket.recvfrom(1024)endrescueTimeout::Errorputs"Timedout!"end 关于ruby-如何在Ruby中设置套接字超时?,我们在StackOverflow上找到一个类似的问题:

ruby-on-rails - Heroku:使用回形针运行 imagemagick

我已经在我的macosx计算机上安装了imagemagick,现在我想将它部署到heroku。我已经在heroku上安装了回形针插件,但在上传图片时出现此错误:Paperclip::CommandNotFoundError我以前没有在我的计算机上安装imagemagick但现在我想部署它时出现此错误,我如何让imagemagick在heroku上工作? 最佳答案 您的Heroku应用中是否包含RMagickgem?它对于Ruby代码和ImageMagick之间的接口(interface)是必要的。默认情况下,ImageMagick是

ruby-on-rails - 如何在 heroku 上查看你的 gem 列表

我知道执行此操作的命令,但我不明白为什么。`...`在此上下文中做什么。我知道我可以跑:herokuconsole`gemlist`或herokuconsole`gemlist`.split("\n")得到一个不错的输出,但我不明白这些在做什么。为什么是``? 最佳答案 我已经更新了这个,以防有人碰巧遇到herokuconsole,因为它已被禁用。herokurungemlist显示通过:git安装的gemsherokurunbundleshow 关于ruby-on-rails-如何在h

ruby - 如何在 Heroku 上托管的 Ruby/Sinatra 应用程序中设置 HTTP header ?

我有一个基于Ruby和Sinatra的工作应用程序部署在Heroku上。我想利用Heroku上可用的HTTP缓存,它使用Varnish。我不确定设置header的最佳方式是什么,以及正确的语法。对最佳方法和语法有什么想法吗?beforedoheaders"Content-Type"=>"text/html;charset=utf8"endget'/'doheaders['Cache-Control']='public,max-age=600'#SOMESTUFFHEREhaml:home,{:layout=>:layout_minfooter}end 最佳答

ruby - "puts"输出未显示在 Sinatra 应用程序的 Heroku 日志中

我正在尝试使用“puts”来测试托管在Heroku上的Sinatra应用程序的一些内容。有趣的是,输出似乎排队并且仅在重新启动Herokudyno时显示。我尝试过使用“Thin”和“Webrick”,但遇到了同样的问题。有什么想法吗? 最佳答案 正如您在herokudocs上看到的那样:将此添加到您的config.ru:$stdout.sync=true不要忘记stdout之前的$否则它不会工作。 关于ruby-"puts"输出未显示在Sinatra应用程序的Heroku日志中,我们在S

如何在PHP中动态获取页面标题

我获得了我的主页标题,但是在获取内部页面(可变帖子)方面,它不起作用。$path=$_SERVER['PHP_SELF'];$page_title=basename($path);switch($page_title){case'index.php':$title="Welcometothethewebsite";$description="descriptiongoeshere";break;case'about.php':$title="Welcometothethewebsite";$description="somehtinfd";break;case'career.php':$tit

ruby-on-rails - 1 个 Heroku dyno 上有多少个 Rails 应用程序?

我只是找不到一个dyno可以在heroku上托管多少个应用程序?我计划托管很多流量很小的小应用。感谢您的回答 最佳答案 Dynos是根据每个应用程序计算的。但是,这并不意味着您需要购买3个测功机才能运行3个应用程序。您可以创建3个应用程序,每个应用程序有1个dyno。 关于ruby-on-rails-1个Herokudyno上有多少个Rails应用程序?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com

ruby-on-rails - 如何更改 Heroku 中的列类型?

我正在尝试将db:migrations放入我的heorku实例中,但出现错误。常见问题解答如下描述了我的错误:CannotchangecolumntypeExample:PGError:ERROR:column“verified_at”cannotbecasttotype“date”Cause:PostgreSQLdoesn’tknowhowtocastalltherowsinthattabletothespecifiedtype.Mostlikelyitmeansyouhaveanintegerorastringinthatcolumn.Solution:Inspectyourrec

ruby - Heroku Rails 4 无法连接到服务器 : connection refused

使用postgres。一直推不开。没有任何运气尝试过:config.assets.initialize_on_precompile=false----->PreparingappforRailsassetpipelineRunning:rakeassets:precompilerakeaborted!couldnotconnecttoserver:ConnectionrefusedIstheserverrunningonhost"127.0.0.1"andacceptingTCP/IPconnectionsonport5432? 最佳答案